<{if $aCart.object.goods}>
<form action="<{link app=b2c ctl=site_cart act=_check_checkout}>" method="post" id="order-checkout" >
    <!-- 购物车内容 -->
    <{if $aCart.no_pre_sale}>
    <div class="table-responsive">
        <div class="table_tit  mar-t-10">
            <span class="fl mar-l-10">Товары в наличии</span>
            <span class="fr mar-r-10 changeno">
               <span>Свернуть</span>
                <i class="glyphicon glyphicon-triangle-top"></i>
            </span>
        </div>

        <table  class="cart-main table table-bordered table-hover table-striped" >
            <colgroup>
                <col class="col-1">
                <col class="col-2">
                <col class="col-3">
                <col class="col-4">
                <col class="col-5">
                <col class="col-6">
                <col class="col-7">
                <col class="col-8">
            </colgroup>
            <thead>
            <tr>
                <th>
                    <input class='all_checked' type="checkbox" name="all_check" checked>
                </th>
                <th colspan="2" width="70" style="text-align:left; padding-left:10px;"><{t}>商品<{/t}></th>
                <th><{t}>销售价<{/t}></th>
                <th><{t}>数量<{/t}></th>
                <th ><{t}>包装<{/t}></th>
                <th ><{t}>优惠金额<{/t}></th>
                <th colspan="2"><{t}>小计<{/t}></th>
                <th colspan="2" ><{t}>操作<{/t}></th>
            </tr>
            </thead>

            <{foreach from=$aCart.object.goods item=goods key=_obj_key}>
            <{if in_array($goods.obj_ident,$aCart.no_pre_sale)}>
            <tbody class="cart-item">
            <!-- 主商品 -->
            <tr class="cart-product<{if !$goods.adjunct}> last<{/if}>">
                <td>
                    <div class="p-ident">
                        <label>
                            <!-- <input class="cart-check-obj" type="checkbox" name="cart_objects_checked[]" value="<{$goods.obj_ident}>" <{if $goods.is_check=='true'}>checked<{/if}>>-->
                            <{if !empty($order)}>
                            <{if in_array($goods.obj_ident,$order)}>
                            <input class="cart-check-obj" type="checkbox" name="cart_objects_checked[]" value="<{$goods.obj_ident}>" checked>
                            <{else}>
                            <input class="cart-check-obj" type="checkbox" name="cart_objects_checked[]" value="<{$goods.obj_ident}>" >
                            <{/if}>
                            <{else}>
                            <input class="cart-check-obj" type="checkbox" name="cart_objects_checked[]" value="<{$goods.obj_ident}>" checked>
                            <{/if}>
                        </label>
                    </div>
                </td>

                <td>
                    <input type="hidden" name="obj_type" value="goods">
                    <input type="hidden" name="goods_ident" value="<{$goods.obj_ident}>">
                    <input type="hidden" name="goods_id" value="<{$goods.obj_items.products.0.goods_id}>">
                    <input type="hidden" name="min" value="1"/>
                    <input type="hidden" name="max" value="<{$goods.store.real}>"/>
                    <input type="hidden" name="stock" value="<{$goods.store.store}>"/>
                    <div class="p-pic">
                        <a href="<{link app=b2c ctl=site_product act=index arg0=$goods.obj_items.products.0.product_id}>" target="_blank"><img src="<{$goods.obj_items.products.0.default_image.thumbnail|default:$env.conf.site.default_thumbnail_pic|storager:'s'}>" alt="<{$goods.obj_items.products.0.name}>"></a>
                </td>
                <td class="p-info">
                    <div class="p-title"><a target="_blank" href="<{link app=b2c ctl=site_product arg0=$goods.obj_items.products.0.product_id}>"><{$goods.obj_items.products.0.name}></a>
                        <!-- 商品促销 -->
                        <div class="p-promotion">
                            <ul>
                                <{foreach from=$aCart.promotion.goods.[$goods.obj_ident] item=goods_promotion}>
                                <{if $goods_promotion.cart_display}>
                                <li>
                                    <b>[<{$goods_promotion.desc_tag}>]</b><{$goods_promotion.name}>
                                </li>
                                <{/if}>
                                <{/foreach}>
                            </ul>
                        </div>
                        <div class="item-vendor-code"><{$goods.obj_items.products.0.bn}></div>
                        <div class="hide item-price"><{$goods.obj_items.products.0.price.price}></div>
                        <div class="hide item-brand"><{$goods.brand}></div>

                    </div>
                    <div class="p-spec<{if !$goods.obj_items.products.0.spec_info}> fix-empty<{/if}>"><{$goods.obj_items.products.0.spec_info|spec_desc}></div>
                    <!-- 赠品 -->
                    <{if $goods.special_type}>
                    <div class="p-gift">
                        <span class="tag"><b>[<{$goods.special_type}>]</b></span>
                    </div>
                    <{/if}>
                    <{foreach from=$goods.gift item=gift key=_gift_key}>
                    <div class="p-gift">
                        <b>[赠品]</b><a target="_blank" href="<{link app=gift ctl=site_gift arg0=$gift.product_id}>"><{$gift.name}><{$gift.spec_info|spec_desc}></a> <i><{$gift.price.price|cur_odr}> x <{$gift.quantity}></i>
                    </div>
                    <{/foreach}>

                </td>
                <td class="p-price"><{$goods.s_price|cur_odr}>/<{t}><{$goods.bag_unit}><{/t}></td>
                <td>
                    <div class="p-quantity">
                        <a  href="javascript:void(0);" class="btn-decrease">-</a>
                        <input type="text" name="modify_quantity[<{$goods.obj_ident}>][quantity]" value="<{$goods.quantity}>">
                        <a href="javascript:void(0);" class="btn-increase">+</a><span><{t}><{$goods.unit}><{/t}></span>
                    </div>
                    <{if $goods.store.store == 0}><span class="warn-message"><{t}>库存不足<{/t}></span>
                    <{elseif $goods.store.store <= 5}><span class="warn-message"><{t}>余量有限<{/t}></span><{/if}>
                </td>

                <td class="p-bagunit"><{t}><{$goods.bag_unit_str}><{/t}></td>
                <td class="p-discount"><{($goods.discount_amount_prefilter)+(($goods.obj_items.products.0.price.price-$goods.obj_items.products.0.price.member_lv_price)*$goods.quantity)|cur_odr}></td>

                <td class="p-subtotal" colspan="2"><{$goods.subtotal_prefilter_after|cur_odr}></td>
                <td class="p-action" colspan="2">
                    <{if $login=='nologin'}>
                    <a  href="<{link app=b2c ctl=site_passport act=login}>" class="btn-fav"><span class="glyphicon glyphicon-heart"></span></a>
                    <{else}>
                    <a href="javascript:void(0);" class="btn-fav" rel="_addfav_" data-gid="<{$goods.obj_items.products.0.goods_id}>"><span class="glyphicon glyphicon-heart"></span></a>
                    <{/if}>
                    <i>|</i>
                    <a href="javascript:void(0);" class="btn-delete"><span class="glyphicon glyphicon-remove"></span></a>
                </td>
            </tr>
            <!-- 配件 -->
            <{foreach from=$goods.adjunct item=adjunct key=key name=adjunct}>
            <tr class="p-adjunct<{if $smarty.foreach.adjunct.last}> last<{/if}>">
                <td>
                    <input type="hidden" name="obj_type" value="goods">
                    <input type="hidden" name="min" value="<{$adjunct.store.min_buy_store}>"/>
                    <input type="hidden" name="max" value="<{$adjunct.store.real}>"/>
                    <input type="hidden" name="stock" value="<{$adjunct.store.store}>"/>
                    <div class="p-adjunct-icon"><{t}>配件<{/t}><br><{t}>商品<{/t}></div>
                </td>
                <td class="p-info">
                    <div class="p-pic">
                        <a target="_blank" href="<{link app=b2c ctl=site_product arg0=$adjunct.product_id}>"><img src="<{$adjunct.default_image.thumbnail|default:$env.conf.site.default_thumbnail_pic|storager:'s'}>" alt="<{$adjunct.name}>,<{$adjunct.spec_info}>"></a>
                    </div>
                    <div class="p-title"><a target="_blank" href="<{link app=b2c ctl=site_product arg0=$adjunct.product_id}>"><{$adjunct.name}>,<{$adjunct.spec_info|spec_desc}></a></div>
                </td>
                <td class="p-price"><{$adjunct.json_price.price|cur_odr}></td>
                <td>
                    <div class="p-quantity">
                        <a href="javascript:void(0);" class="btn-decrease">-</a>
                        <input type="text" name="modify_quantity[<{$goods.obj_ident}>][adjunct][<{$adjunct.group_id}>][<{$adjunct.product_id}>][quantity]" id="" value="<{if $adjunct.store.store == 0}>0<{else}><{$adjunct.quantity}><{/if}>">
                        <a href="javascript:void(0);" class="btn-increase">+</a>
                    </div>
                    <{if $adjunct.store.store == 0}>
                    <span class="warn-message"><{t}>库存不足<{/t}></span>
                    <{elseif $adjunct.store.store <= 5}>
                    <span class="warn-message"><{t}>余量有限<{/t}></span>
                    <{/if}>
                </td>
                <td class="p-discount"><{($adjunct.json_price.price-$adjunct.price.price)*$adjunct.quantity|cur_odr}></td>
                <td class="p-integral">
                    <{if ($adjunct.gain_score * $adjunct.quantity)}>
                    <{($adjunct.gain_score * $adjunct.quantity)}>
                    <{else}>
                    -
                    <{/if}>
                </td>
                <td class="p-subtotal"><{$adjunct.subtotal_price|cur_odr}></td>
                <td class="p-action">
                    <{if $login=='nologin'}>
                    <a href="<{link app=b2c ctl=site_passport act=login}>" class="btn-fav"><span class="glyphicon glyphicon-heart"></span></a>
                    <{else}>
                    <a href="javascript:void(0);" class="btn-fav" rel="_addfav_" data-gid="<{$adjunct.goods_id}>"><span class="glyphicon glyphicon-heart"></span></a>
                    <{/if}>
                    <i>|</i>
                    <a href="javascript:void(0);" class="btn-delete"><span class="glyphicon glyphicon-remove"></span></a>
                </td>
            </tr>
            <{/foreach}>
            </tbody>
            <{/if}>
            <{/foreach}>
        </table>
    </div>
    <{/if}>

    <{if $aCart.is_pre_sale}>
    <div class="table-responsive presalebox">
        <div class="table_tit">
            <span class="fl mar-l-10">Товары под заказ</span>
             <span class="fr mar-r-10 changeno">
               <span>Свернуть</span>
                <i class="glyphicon glyphicon-triangle-top"></i>
            </span>
        </div>
        <table  class="cart-main table table-bordered table-hover table-striped" >
            <colgroup>
                <col class="col-1">
                <col class="col-2">
                <col class="col-3">
                <col class="col-4">
                <col class="col-5">
                <col class="col-6">
                <col class="col-7">
                <col class="col-8">
            </colgroup>
            <thead>
            <tr>
                <th>
                    <input class='all_checked' type="checkbox" name="all_check" checked>
                </th>
                <th colspan="2" width="70" style="text-align:left; padding-left:10px;"><{t}>商品<{/t}></th>
                <th><{t}>销售价<{/t}></th>
                <th><{t}>数量<{/t}></th>
                <th ><{t}>包装<{/t}></th>
                <th ><{t}>优惠金额<{/t}></th>
                <th colspan="2"><{t}>小计<{/t}></th>
                <th colspan="2" ><{t}>操作<{/t}></th>
            </tr>
            </thead>

            <{foreach from=$aCart.object.goods item=goods key=_obj_key}>
            <{if in_array($goods.obj_ident,$aCart.is_pre_sale)}>
            <tbody class="cart-item">
            <!-- 主商品 -->
            <tr class="cart-product<{if !$goods.adjunct}> last<{/if}>">
                <td>
                    <div class="p-ident">
                        <label>
                            <!-- <input class="cart-check-obj" type="checkbox" name="cart_objects_checked[]" value="<{$goods.obj_ident}>" <{if $goods.is_check=='true'}>checked<{/if}>>-->
                            <{if !empty($order)}>
                            <{if in_array($goods.obj_ident,$order)}>
                            <input class="cart-check-obj" type="checkbox" name="cart_objects_checked[]" value="<{$goods.obj_ident}>" checked>
                            <{else}>
                            <input class="cart-check-obj" type="checkbox" name="cart_objects_checked[]" value="<{$goods.obj_ident}>" >
                            <{/if}>
                            <{else}>
                            <input class="cart-check-obj" type="checkbox" name="cart_objects_checked[]" value="<{$goods.obj_ident}>" checked>
                            <{/if}>
                        </label>
                    </div>
                </td>

                <td>
                    <input type="hidden" name="obj_type" value="goods">
                    <input type="hidden" name="goods_ident" value="<{$goods.obj_ident}>">
                    <input type="hidden" name="goods_id" value="<{$goods.obj_items.products.0.goods_id}>">
                    <input type="hidden" name="min" value="1"/>
                    <input type="hidden" name="max" value="<{$goods.store.real}>"/>
                    <input type="hidden" name="stock" value="<{$goods.store.store}>"/>
                    <div class="p-pic">
                        <a href="<{link app=b2c ctl=site_product act=index arg0=$goods.obj_items.products.0.product_id}>" target="_blank"><img src="<{$goods.obj_items.products.0.default_image.thumbnail|default:$env.conf.site.default_thumbnail_pic|storager:'s'}>" alt="<{$goods.obj_items.products.0.name}>"></a>
                </td>
                <td class="p-info">
                    <div class="p-title"><a target="_blank" href="<{link app=b2c ctl=site_product arg0=$goods.obj_items.products.0.product_id}>"><{$goods.obj_items.products.0.name}></a>
                        <!-- 商品促销 -->
                        <div class="p-promotion">
                            <ul>
                                <{foreach from=$aCart.promotion.goods.[$goods.obj_ident] item=goods_promotion}>
                                <{if $goods_promotion.cart_display}>
                                <li>
                                    <b>[<{$goods_promotion.desc_tag}>]</b><{$goods_promotion.name}>
                                </li>
                                <{/if}>
                                <{/foreach}>
                            </ul>
                        </div>


                        <div class="item-vendor-code"><{$goods.obj_items.products.0.bn}></div>
                        <div class="hide item-price"><{$goods.obj_items.products.0.price.price}></div>
                        <div class="hide item-brand"><{$goods.brand}></div>

                    </div>
                    <div class="p-spec<{if !$goods.obj_items.products.0.spec_info}> fix-empty<{/if}>"><{$goods.obj_items.products.0.spec_info|spec_desc}></div>
                    <!-- 赠品 -->
                    <{if $goods.special_type}>
                    <div class="p-gift">
                        <span class="tag"><b>[<{$goods.special_type}>]</b></span>
                    </div>
                    <{/if}>
                    <{foreach from=$goods.gift item=gift key=_gift_key}>
                    <div class="p-gift">
                        <b>[赠品]</b><a target="_blank" href="<{link app=gift ctl=site_gift arg0=$gift.product_id}>"><{$gift.name}><{$gift.spec_info|spec_desc}></a> <i><{$gift.price.price|cur_odr}> x <{$gift.quantity}></i>
                    </div>
                    <{/foreach}>
                </td>
                <td class="p-price"><{$goods.s_price|cur_odr}>/<{t}><{$goods.bag_unit}><{/t}></td>
                <td>
                    <div class="p-quantity">
                        <a  href="javascript:void(0);" class="btn-decrease">-</a>
                        <input type="text" name="modify_quantity[<{$goods.obj_ident}>][quantity]" value="<{$goods.quantity}>">
                        <a href="javascript:void(0);" class="btn-increase">+</a><span><{t}><{$goods.unit}><{/t}></span>
                    </div>
                    <{if $goods.store.store == 0}><span class="warn-message"><{t}>库存不足<{/t}></span>
                    <{elseif $goods.store.store <= 5}><span class="warn-message"><{t}>余量有限<{/t}></span><{/if}>
                </td>

                <td class="p-bagunit"><{t}><{$goods.bag_unit_str}><{/t}></td>
                <td class="p-discount"><{($goods.discount_amount_prefilter)+(($goods.obj_items.products.0.price.price-$goods.obj_items.products.0.price.member_lv_price)*$goods.quantity)|cur_odr}></td>

                <td class="p-subtotal" colspan="2"><{$goods.subtotal_prefilter_after|cur_odr}></td>
                <td class="p-action" colspan="2">
                    <{if $login=='nologin'}>
                    <a  href="<{link app=b2c ctl=site_passport act=login}>" class="btn-fav"><span class="glyphicon glyphicon-heart"></span></a>
                    <{else}>
                    <a href="javascript:void(0);" class="btn-fav" rel="_addfav_" data-gid="<{$goods.obj_items.products.0.goods_id}>"><span class="glyphicon glyphicon-heart"></span></a>
                    <{/if}>
                    <i>|</i>
                    <a href="javascript:void(0);" class="btn-delete"><span class="glyphicon glyphicon-remove"></span></a>
                </td>
            </tr>
            <!-- 配件 -->
            <{foreach from=$goods.adjunct item=adjunct key=key name=adjunct}>
            <tr class="p-adjunct<{if $smarty.foreach.adjunct.last}> last<{/if}>">
                <td>
                    <input type="hidden" name="obj_type" value="goods">
                    <input type="hidden" name="min" value="<{$adjunct.store.min_buy_store}>"/>
                    <input type="hidden" name="max" value="<{$adjunct.store.real}>"/>
                    <input type="hidden" name="stock" value="<{$adjunct.store.store}>"/>
                    <div class="p-adjunct-icon"><{t}>配件<{/t}><br><{t}>商品<{/t}></div>
                </td>
                <td class="p-info">
                    <div class="p-pic">
                        <a target="_blank" href="<{link app=b2c ctl=site_product arg0=$adjunct.product_id}>"><img src="<{$adjunct.default_image.thumbnail|default:$env.conf.site.default_thumbnail_pic|storager:'s'}>" alt="<{$adjunct.name}>,<{$adjunct.spec_info}>"></a>
                    </div>
                    <div class="p-title"><a target="_blank" href="<{link app=b2c ctl=site_product arg0=$adjunct.product_id}>"><{$adjunct.name}>,<{$adjunct.spec_info|spec_desc}></a></div>
                </td>
                <td class="p-price"><{$adjunct.json_price.price|cur_odr}></td>
                <td>
                    <div class="p-quantity">
                        <a href="javascript:void(0);" class="btn-decrease">-</a>
                        <input type="text" name="modify_quantity[<{$goods.obj_ident}>][adjunct][<{$adjunct.group_id}>][<{$adjunct.product_id}>][quantity]" id="" value="<{if $adjunct.store.store == 0}>0<{else}><{$adjunct.quantity}><{/if}>">
                        <a href="javascript:void(0);" class="btn-increase">+</a>
                    </div>
                    <{if $adjunct.store.store == 0}>
                    <span class="warn-message"><{t}>库存不足<{/t}></span>
                    <{elseif $adjunct.store.store <= 5}>
                    <span class="warn-message"><{t}>余量有限<{/t}></span>
                    <{/if}>
                </td>
                <td class="p-discount"><{($adjunct.json_price.price-$adjunct.price.price)*$adjunct.quantity|cur_odr}></td>
                <td class="p-integral">
                    <{if ($adjunct.gain_score * $adjunct.quantity)}>
                    <{($adjunct.gain_score * $adjunct.quantity)}>
                    <{else}>
                    -
                    <{/if}>
                </td>
                <td class="p-subtotal"><{$adjunct.subtotal_price|cur_odr}></td>
                <td class="p-action">
                    <{if $login=='nologin'}>
                    <a href="<{link app=b2c ctl=site_passport act=login}>" class="btn-fav"><span class="glyphicon glyphicon-heart"></span></a>
                    <{else}>
                    <a href="javascript:void(0);" class="btn-fav" rel="_addfav_" data-gid="<{$adjunct.goods_id}>"><span class="glyphicon glyphicon-heart"></span></a>
                    <{/if}>
                    <i>|</i>
                    <a href="javascript:void(0);" class="btn-delete"><span class="glyphicon glyphicon-remove"></span></a>
                </td>
            </tr>
            <{/foreach}>
            </tbody>
            <{/if}>
            <{/foreach}>


        </table>
    </div>
    <{/if}>

    <div class="table-responsive" >
        <table  class="cart-main table table-bordered table-hover table-striped" >
            <tfoot>
            <tr>
                <{include file="site/cart/cart_solution.html" app=b2c}>
                <{include file="site/cart/cart_total.html" app=b2c}>
            </tr>

            <tr>
                <!-- 按钮 -->
                <td colspan="6" class="cart-left">
                    <{button type="button" class="btn btn-default action-clean" label=$___b2c="清空购物车"|t:'b2c'}>
                    <{if $fororder_show == 'true'}>
                    <{button type="button" class="btn btn-default action-fororder" label=$___b2c="凑单商品"|t:'b2c'}>
                    <{/if}>
                </td>
                <td colspan="4" class="cart-right">
                    <a href="./" class="btn btn-default"><{t}>继续购物<{/t}></a>
                    <{button type="submit" icon_r="►" class="btn btn-primary action-settle"  rel="_request" label=$___b2c="下单结算"|t:'b2c'}>
                </td>
            </tr>
            </tfoot>
        </table>
    </div>

</form>
<{/if}>

